﻿using System.Reflection;
using CSharpBasic;

namespace Helper;

public static class HelperTools
{
    public static void Console_WriteLine_ChangeColor(ConsoleColor consoleColor, string format, params object?[]? arg)
    {
        ConsoleColor _color = Console.ForegroundColor; 
        Console.ForegroundColor = consoleColor;
        Console.WriteLine(format, arg);
        Console.ForegroundColor = _color;
    }

    public static void InvokeMainFunc(System.Type _type)
    {
        MethodInfo _methodInfo = _type.GetMethod("Main", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
        _methodInfo?.Invoke(null, null);
    }
}